package com.k7.mobile.platform.bo.impl;

import java.util.List;

import com.k7.mobile.platform.bo.IGramimageBO;
import com.k7.mobile.platform.dao.IGramimageDAO;
import com.k7.mobile.platform.dataobject.GramimageDO;
import com.k7.mobile.platform.exception.BOException;

public class GramimageBOImpl extends BaseBOImpl implements IGramimageBO{
	
	private IGramimageDAO gramimageDAO;

	public void setGramimageDAO(IGramimageDAO gramimageDAO) {
		this.gramimageDAO = gramimageDAO;
	}

	public Long add(GramimageDO gramimageDO) throws BOException {
		try{ 
			Long id=gramimageDAO.add(gramimageDO);
			return id;
		}catch(Exception ex){
			log.error("GramimageBOImpl:add,插入Gramimage失败", ex);
			throw new BOException("创建禁止Gramimage失败", ex);
		}
	}

	@Override
	public void delete(GramimageDO gramimageDO) throws BOException {
		try{
			gramimageDAO.delete(gramimageDO);
		}catch(Exception ex){
			log.error("GramimageBOImpl:delete,删除Gramimage失败", ex);
			throw new BOException("删除Gramimage失败", ex);
		}
		
	}
	@Override
	public void update(GramimageDO gramimageDO) throws BOException {
		try{
			gramimageDAO.update(gramimageDO);
		}catch(Exception ex){
			log.error("GramimageBOImpl:delete,更新Gramimage失败", ex);
			throw new BOException("更新Gramimage失败", ex);
		}
		
	}

	@Override
	public List<GramimageDO> findList(GramimageDO gramimageDO) throws BOException {
		try{
			List<GramimageDO> list = gramimageDAO.findList(gramimageDO);
			return list;
		}catch(Exception ex){
			log.error("GramimageBOImpl:findList,批量获取Gramimage信息出错", ex);
			throw new BOException("批量获取Gramimage信息出错", ex);
		}
		
	}

	@Override
	public GramimageDO getGramimage(GramimageDO gramimageDO) throws BOException {
		try{

			GramimageDO returnDO = gramimageDAO.getGramimage(gramimageDO);

			return returnDO;
		}catch(Exception ex){
			log.error("GramimageBOImpl:getGramimage,获取Gramimage信息出错", ex);
			throw new BOException("获取Gramimage信息出错", ex);
		}
	}
}
